Fixed integration with OpenAI Codex (v0.114.0) with gpt-5.4#41
Closed
dabogee wants to merge 8 commits intoCaddyGlow:mainfrom
Closed
Fixed integration with OpenAI Codex (v0.114.0) with gpt-5.4#41dabogee wants to merge 8 commits intoCaddyGlow:mainfrom
dabogee wants to merge 8 commits intoCaddyGlow:mainfrom
Conversation
- Fix mypy type errors: add type annotations for format_chain list elements, cast WebSocket adapter return, wrap Response.body for json.loads, use LLMSettings instead of raw dicts in tests - Fix ruff SIM105: replace try/except/pass with contextlib.suppress - Fix WebSocket accept/auth ordering: accept before authenticate so close codes work correctly on rejection - Type WebSocket helpers with CodexAdapter instead of Any - Bound local_response_ids with deque(maxlen=256) to prevent unbounded growth on long-lived connections - Make _load_codex_cli_models_cache async with anyio.Path to avoid blocking the event loop with synchronous filesystem I/O - Add structured logging to WebSocket handler lifecycle - Add debug logging to _safe_fallback_data in detection service - Fix _normalize_input_messages to avoid mutating input dict in-place - Remove redundant pass statements after logger.debug calls - Refactor test_msaf_real_library to use plain httpx.AsyncClient, removing agent_framework and openai library dependencies
Add parameterized WebSocket e2e tests following test_endpoint_e2e.py pattern, covering warmup, streaming, error, and multi-message flows for both /codex/v1/responses and /codex/responses endpoints. - Add WS_ENDPOINT_CONFIGURATIONS and request builders to test_data.py - Add WebSocket validation helpers to e2e_validation.py - Add live server tests gated by CCPROXY_BASE_URL env var - Remove agent-framework-core and agent-framework-orchestrations from test dependencies (test_msaf_real_library refactored to plain httpx)
1. Add ThinkingConfigAdaptive to the request validation schema to
support Claude 4-6+ models that use thinking: {"type": "adaptive"}.
2. Fix anthropic-beta header handling: use minimal required tags
(claude-code-20250219, oauth-2025-04-20) and block CLI fallback
headers from overwriting them. The fallback data included tags
like fine-grained-tool-streaming-2025-05-14 that triggered
"long context beta not available" errors for some subscriptions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Support summarized/omitted display modes for adaptive thinking responses.
Contributor
Author
|
hi @CaddyGlow ! Could you please trigger a CI? Made checks locally, has to be Ok |
This was referenced Mar 20, 2026
Owner
|
This PR has been split into 3 focused PRs for easier review and independent merging:
Closing in favor of the above. |
This was referenced Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Codex proxy compatibility for HTTP, WebSocket. Integration with Microsoft Agent Framework, CrewAI and OpenAI Agents SDK has been validated.
Summary
This PR extends the Codex proxy compatibility work beyond the original HTTP and WebSocket fixes. In addition to making native Codex Desktop /
codex exectraffic work end-to-end, it adds support for OpenAI-compatible multi-agent workflows, improves bypass-mode behavior, and makes mock responses format-aware across chat, responses, and Anthropic routes.After these changes:
POST /codex/v1/responsessucceeds through the proxyPOST /codex/v1/chat/completionssucceeds through the proxycodex execworks throughOPENAI_BASE_URL=http://127.0.0.1:8000/codex/v1/codex/v1/modelsWhat Was Broken
400 Bad Request/codex/v1/modelsdid not expose the richer model metadata expected by Codex Desktopresponsesprevious_response_id, which upstream rejected/chat/completionsvs/responsesTests
Added or updated coverage for:
openai_thinking_xmlformat_chainand endpoint fallback/modelscompatibility pathsValidation
Previously validated flows remain:
uv buildPOST /codex/v1/responsesreturned200withOKPOST /codex/v1/chat/completionsreturned200withOKcodex execthrough the proxy returnedOKPowered by gpt-5.4, reviewed by claude-4.5-sonnet, Junie